feat: scaffold transaction presentation in bdk_demo active wallet flow#62
feat: scaffold transaction presentation in bdk_demo active wallet flow#62j-kon wants to merge 8 commits intobitcoindevkit:mainfrom
Conversation
|
@Johnosezele cc |
|
Nice improvement to the demo flow and the widget coverage is solid. I found one correctness issue before approval: TransactionDetailPage caches its future in initState, but go_router keys matched pages by the route pattern, so changing /transactions/:txid can reuse the same State and leave the screen showing the old transaction. Once that lifecycle case is handled, this is looking pretty good to merge. |
Good catch, that makes sense. I’ll update the page to handle route changes properly instead of caching in initState. |
|
Good catch on that — makes sense. I’ve fixed it by refreshing the cached future in Also added a widget test to cover this exact case (same page instance, different txid). Everything’s passing on my end. Happy to adjust if you prefer a different approach. CC @reez |
Johnosezele
left a comment
There was a problem hiding this comment.
Thanks for taking this on! Great changes in the UI side of things.
I recognize this as a scaffold pr but I think there's some mixup from the ground up
You're not fetching transaction details from CanonicalTx of bdk.dart where sent/received come from wallet.sentAndReceived().
For your changes on the wallet_service.dart file, you are mostly return hardcoded placeholder data, you're not making use of our bdk.dart bindings api, I can't see any of the related methods, can you take a look at this commit. By extension this has a huge impact on wallet_providers.dart
For the test section of your PR, We'd need to structure /bdk_demo/test because as our test suite grows things may begin to look tightly coupled, part of what I did in the /test section of this commit which is still draft.
@reez pls can you hold off on merging this just yet, there seem to be alot of parallel implementation conflict as this is a scaffold pr, it would need to be rebased due to lots of conflicting changes with [this](https://github.com/bitcoindevkit/bdk-dart/pull/61)
|
Thanks a lot for the detailed review — this really helps. I see what you mean about the mixup with using placeholder data instead of wiring through the bdk.dart APIs, and also the structure concerns around the demo/tests. I’ll take a step back and align this properly with the existing architecture, rework the service layer to use CanonicalTx / wallet APIs, and clean up the structure as suggested. Also noted on the README and shared widgets — I’ll split those changes out and refactor accordingly. Appreciate the guidance here 🙏 |
|
merged #61 so can rebase this branch |
2d3e933 to
bebb956
Compare
Thanks, I’ve now rebased this branch. |
Cool I'll let John take a look to see if all his comments are resolved 👍 |
Johnosezele
left a comment
There was a problem hiding this comment.
I expect the Transaction flow to exist as a separate feature module, instead of being implemented by repurposing ActiveWalletsPage / wallet_setup to act like a “reference scaffold”.
I’d expect something closer to:
features/transactions/transactions_list_page.darttransaction_detail_page.darttransactions_controller.dart(Riverpod Notifier)transactions_repository.dart(interface)
services/stays focused on actual wallet / persistence concerns (WalletService,StorageService, etc.)- any placeholder/demo data should live behind a demo
TransactionsRepository(or fake) rather than insideWalletService.
Thanks for adding coverage, the widget tests are valuable (esp. the tx detail route reuse / txid refresh case).
That said, this PR still doesn’t really follow the earlier direction about keeping /bdk_demo/test structured as it grows (to avoid tightly-coupled test files and to keep helpers reusable).
I can see that FakeWalletService + placeholder transaction fixtures are defined inside app_shell_test.dart, and similar fixtures appear again in active_wallets_page_test.dart.
In the end, something like this is ideal:
test/presentation/transactions/transaction_detail_page_test.darttest/presentation/wallet_setup/reference_wallet_scaffold_page_test.dart(or wherever this flow lands)test/helpers/fakes/fake_wallet_service.darttest/helpers/fixtures/placeholder_transactions.dart
This way tests remain feature-scoped, helpers are shared, and future PRs can add coverage without growing single files indefinitely.
|
Thanks @Johnosezele, this is clear. I see the core issue now: the transaction scaffold should be introduced as its own feature module instead of being layered onto I’m going to refactor this in that direction by:
Thanks for the detailed review. |
|
Maybe in the future try to create a commit per fix, its easier to review that way. I can see all of my comments marked as resolved but its hard to track which is which from the diff in your recent commit. |
|
Thanks. I agree the last refactor landed as a larger commit than ideal. I’ll keep future follow-up work split into smaller fix-by-fix commits so it’s easier to review and map comments back to changes. Appreciate the review. |
Summary
Adds a transaction detail flow to the reference wallet scaffold.
What changed
TransactionDetailPageto display:WalletService.loadTransactionByTxidFakeWalletServiceNotes